<template>
  <div class="shop-container">
    <v-header :shop='shop'></v-header>
    <mainContent></mainContent>
  </div>
</template>

<script>
import VHeader from './header/header'
import api from '@/API/index'
import mainContent from './main/main'

export default {
  name: 'shop',
  data() {
    return {
      shopId: null,
      shop: {
        avatar: '',
        name: '',
        description: ''
      },
    }
  },
  methods: {
    getShopInfo(shopId) {
      api.GET_SHOP_INFO({ shopId }).then(({ data }) => {
        if (data.status == 200) {
          this.shop = data.data.shop
        }
      })
    }
  },
  created() {
    this.shopId = this.$route.params.shopId
  },
  mounted() {
    // this.getGoodsByShopId(this.shopId)
    this.getShopInfo(this.shopId)
  },
  components: {
    'v-header': VHeader,
    mainContent
  }
}
</script>

<style lang="less" scoped>
.shop-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

</style>
